#include "tcpserver.hpp"
#include "http.hpp"

using namespace http_ns;

void Usage(std::string proc)
{
    std::cout << "Usage:\n\t" << proc << " serverip serverport\n"
              << std::endl;
}

int main(int argc, char* argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(1);
    }

    uint16_t serverport = stoi(argv[1]);

    HTTP http;
    TcpServer server(serverport, bind(&HTTP::deal, &http, placeholders::_1));
    server.Start();


    return 0;
}